package exam.business.service;

import exam.common.constant.ResultPort;
import exam.common.key.KeyUser;
import exam.common.util.LongUtils;
import exam.common.util.NullCheckUtil;
import exam.model.dao.TUserDAO;
import exam.system.business.AbstractService;
import exam.system.business.BusinessServiceInfo;
/**
 * <p>UserDeleteService</p>
 * <p>Xoa thong tin nguoi dung</p>
 * 
 * @author Phong
 * @version (create: 19/5/2012) (update: 21/5/2012)
 */
public class UserDeleteService extends AbstractService {
	private TUserDAO tUserDAO = new TUserDAO();
	@Override
	public String executeService(BusinessServiceInfo serviceInfo)
			throws Exception {
		// lay userId
		String userId = serviceInfo.getString(KeyUser.USER_ID);
		if(NullCheckUtil.isNull(userId)) {
			return ResultPort.ERROR;
		}
		tUserDAO.deleteUserByPk(LongUtils.convertStringToLong(userId));
		return ResultPort.SUCCESS;
	}
}
